﻿using System.Collections.Generic;
using System.Windows.Forms;
using HighDiveEngine.Aggregates;
using HighDiveEngine.Model;

namespace HighDiveAdmin.GUI
{
    public class DiverTreeNode : TreeNode
    {
        public Diver Diver { get; set; }
        public DiverTreeNode(Diver diver, DiveList diveList) : base(diver.ToString())
        {
            Diver = diver;
            var childNodes = new List<DiveTreeNode>();
            foreach (var dive in diveList)
            {
                childNodes.Add(new DiveTreeNode(dive));
            }
            Nodes.AddRange(childNodes.ToArray());
        }
    }
}
